package com.woniuxy.service.impl;

import com.woniuxy.service.RbacManagerService;
import com.woniuxy.entity.RbacManager;

import java.util.List;

/**
 * @Author: 马宇航
 * @Todo: 模拟JDK动态代理的效果
 * @DateTime: 22/08/22/0022 14:25
 * @Component: 成都蜗牛学苑
 **/
public class RbacManagerServiceImpl2 implements RbacManagerService {
    //这个service 就是注入的 原本的被代理对象 RbacManagerServiceImpl
    private RbacManagerService rbacManagerService;

    public void setRbacManagerService(RbacManagerService rbacManagerService) {
        this.rbacManagerService = rbacManagerService;
    }

    @Override
    public RbacManager findOne(int id) {
        return null;
    }

    @Override
    public List<RbacManager> findAll() {
        System.out.println("模拟JDK动态增强效果前置日志！");
        List<RbacManager> all = rbacManagerService.findAll();//rbacManagerService指向地址 RbacManagerServiceImpl
        System.out.println("模拟JDK动态增强效果后置日志！");
        return all;
    }

    @Override
    public int addOne(RbacManager rbacManager) {
        return 0;
    }

    @Override
    public int updateOne(RbacManager rbacManager) {
        return 0;
    }

    @Override
    public int deleteOne(int id) {
        return 0;
    }
}
